package com.lanxiao.cloud.modules.log.application.dto;

import com.lanxiao.cloud.common.core.dto.UserBaseDto;
import com.lanxiao.cloud.common.core.enums.OperationType;
import com.lanxiao.cloud.common.core.enums.StateEnum;
import com.lanxiao.cloud.modules.log.domain.Topic;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;

/**
 * @author ：qiaoliang
 * @date ：2021-10-15
 */
@ApiModel("日志信息返回模型")
public class LogDto {
  @ApiModelProperty("id")
  private final String id;
  @ApiModelProperty("url")
  private final String url;
  @ApiModelProperty("类名")
  private final String className;
  @ApiModelProperty("方法名")
  private final String methodName;
  @ApiModelProperty("方法描述")
  private final String methodDescription;
  @ApiModelProperty("请求参数")
  private final Object requestParams;
  @ApiModelProperty("返回参数")
  private final Object responseParams;

  @ApiModelProperty("话题")
  private final Topic topic;
  @ApiModelProperty("浏览器")
  private final String browser;
  @ApiModelProperty("操作系统")
  private final String operatingSystem;

  @ApiModelProperty("内容")
  private final Object content;
  @ApiModelProperty("类型")
  private final OperationType type;
  @ApiModelProperty("ip地址")
  private final String ip;
  @ApiModelProperty("地区")
  private final String region;
  @ApiModelProperty(value = "创建时间")
  private final Date createTime;
  @ApiModelProperty(value = "成功失败")
  private final StateEnum state;
  @ApiModelProperty(value = "失败描述")
  private final String errorMessage;
  @ApiModelProperty(value = "耗时")
  private final Long timeConsuming;

  @ApiModelProperty(value = "操作用户")
  private UserBaseDto<Long> createUser;

  public UserBaseDto<Long> getCreateUser() {
    return createUser;
  }

  public void setCreateUser(UserBaseDto<Long> createUser) {
    this.createUser = createUser;
  }

  public LogDto(String id, String url, String className, String methodName,
      String methodDescription, Object requestParams, Object responseParams, Topic topic,
      String browser,
      String operatingSystem, Object content,
      OperationType type, String ip, String region, Date createTime,
      StateEnum state, String errorMessage, Long timeConsuming) {
    this.id = id;
    this.url = url;
    this.className = className;
    this.methodName = methodName;
    this.methodDescription = methodDescription;
    this.requestParams = requestParams;
    this.responseParams = responseParams;
    this.topic = topic;
    this.browser = browser;
    this.operatingSystem = operatingSystem;
    this.content = content;
    this.type = type;
    this.ip = ip;
    this.region = region;
    this.createTime = createTime;
    this.state = state;
    this.errorMessage = errorMessage;
    this.timeConsuming = timeConsuming;
  }

  public String getId() {
    return id;
  }

  public String getUrl() {
    return url;
  }

  public String getClassName() {
    return className;
  }

  public String getMethodName() {
    return methodName;
  }

  public String getMethodDescription() {
    return methodDescription;
  }

  public Object getRequestParams() {
    return requestParams;
  }

  public Object getResponseParams() {
    return responseParams;
  }

  public Topic getTopic() {
    return topic;
  }

  public String getBrowser() {
    return browser;
  }

  public String getOperatingSystem() {
    return operatingSystem;
  }

  public Object getContent() {
    return content;
  }

  public OperationType getType() {
    return type;
  }

  public String getIp() {
    return ip;
  }

  public String getRegion() {
    return region;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public StateEnum getState() {
    return state;
  }

  public String getErrorMessage() {
    return errorMessage;
  }

  public Long getTimeConsuming() {
    return timeConsuming;
  }

}

